// 基础配置
export const BASE_CONFIG = {
  // 基础URL
  baseURL: '/api',
  // 超时时间
  timeout: 10000,
  // 请求头
  headers: {
    'Content-Type': 'application/json',
  },
};

// 响应状态码
export enum ResponseCode {
  SUCCESS = 200,
  UNAUTHORIZED = 401,
  FORBIDDEN = 403,
  NOT_FOUND = 404,
  SERVER_ERROR = 500,
}

// 响应消息
export const ResponseMessage = {
  [ResponseCode.SUCCESS]: '请求成功',
  [ResponseCode.UNAUTHORIZED]: '未授权，请重新登录',
  [ResponseCode.FORBIDDEN]: '拒绝访问',
  [ResponseCode.NOT_FOUND]: '请求错误，未找到该资源',
  [ResponseCode.SERVER_ERROR]: '服务器错误',
};

// 业务状态码
export enum BusinessCode {
  SUCCESS = 200,
  ERROR = 1,
  UNAUTHORIZED = 401,
  FORBIDDEN = 403,
}

// 业务状态消息
export const BusinessMessage = {
  [BusinessCode.SUCCESS]: '操作成功',
  [BusinessCode.ERROR]: '操作失败',
  [BusinessCode.UNAUTHORIZED]: '未授权，请重新登录',
  [BusinessCode.FORBIDDEN]: '拒绝访问',
}; 